package com.fanqiechaodan.redis.controller;

import com.fanqiechaodan.redis.entity.User;
import com.fanqiechaodan.redis.res.Result;
import com.fanqiechaodan.redis.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author fanqiechaodan
 * @Classname UserController
 * @Description
 */
@RestController
@RequestMapping(value = "/user")
public class UserController {

    @Autowired
    UserService userService;

    @GetMapping(value = "/get/{id}")
    public Result<User> getUser(@PathVariable(value = "id")String id){
        User res= userService.getUser(id);
        return Result.success(res);
    }
}
